import java.awt.Color;
import java.sql.SQLException;

/*
 *  Employee.java :This class represents an employee. 
 * 				 It connects to mysql and gets information from there,
 *  			 and spreads this information to the whole program.
 *   @Author : BilCIS
 */

public class Employee extends Features
{
	// properties
	private String name;
	private String surname;
	private String birthdate;
	private String gender;
	private String title;
	private String address;
	private	String number;
	private String password;
	
	private int numOfPermission;
	private int	ID;
	
	private double salary;
	
	private	Mysql mysql;
	// properties ending
	
	// Constructor
	public Employee(String name, String surname, String birthdate, String gender, String title,
			double salary, String address, int numOfPermission, String number, boolean sound,
			Color color, String notes, String gmail_username, String gmail_password, int ID, String password )
	{
		super(ID, sound, color, notes, gmail_username, gmail_password);
		this.name = name;
		this.surname = surname;
		this.birthdate = birthdate;
		this.gender = gender;
		this.title = title;
		this.salary = salary;
		this.address = address;
		this.numOfPermission = numOfPermission;
		this.number = number;
		this.ID = ID;
		this.password = password;
		
		mysql = new Mysql(ID);
	}
	
	// Set methods (Mutators)
	public void setName(String name) throws SQLException
	{
		mysql.setName(name);
	}
	public void setSurname(String surname) throws SQLException
	{
		mysql.setSurname(name);
	}
	public void setBirthdate(String birthdate) throws SQLException
	{
		mysql.setBirthdate(birthdate);
	}
	public void setGender(String gender) throws SQLException
	{
		mysql.setGender(gender);
	}
	public void setTitle(String title) throws SQLException
	{
		mysql.setTitle(title);
	}
	public void setSalary(double salary) throws SQLException
	{
		mysql.setSalary(salary);
	}
	public void setAddress(String address) throws SQLException
	{
		mysql.setAddress(address);
	}
	public void setNumOfPermission(int numOfPermission) throws SQLException
	{
		mysql.setNumOfPermission(numOfPermission);
	}
	public void setNumber(String number) throws SQLException
	{
		mysql.setNumber(number);
	}
	public void setPassword(String password) throws SQLException
	{
		mysql.setPassword(password);
	}
	// Get method (Accessors)
	public String getName()
	{
		return name;
	}
	public String getSurname()
	{
		return surname;
	}
	public String getBirthdate()
	{
		return birthdate;
	}
	public String getGender()
	{
		return gender;
	}
	public String getTitle()
	{
		return title;
	}
	public double getSalary()
	{
		return salary;
	}
	public String getAddress()
	{
		return address;
	}
	public int getNumOfPermission()
	{
		return numOfPermission;
	}
	public String getNumber()
	{
		return number;
	}
	public int getID()
	{
		return ID;
	}
	public String getPassword()
	{
		return password;
	}
	
	// ToString method
	public String toString()
	{
		return  "Name: " + name + "\n" +
				"Surname: " + surname + "\n" +
				"Birthdate: " + birthdate + "\n" +
				"Gender: " + gender + "\n" +
				"Title: " + title + "\n" +
				"Salary: " + salary + "\n" +
				"Address: " + address + "\n" +
				"Number Of Permission: " + numOfPermission + "\n";
	}
	
}
